package horncomb.bpm.process.def;

import horncomb.bpm.BpmException;
import horncomb.bpm.process.core.StateDefinition;
import horncomb.bpm.process.core.Token;
import horncomb.bpm.process.core.Transition;

/**
 * 状态变化异常
 * @author Daniel
 */
public class TansitionException extends BpmException {
	private static final long serialVersionUID = 5810403418809149568L;
	private Token token;
	private Transition transition;
	private StateDefinition stateDefinition;

	public TansitionException(String msg, Token token, Transition transition,
			StateDefinition stateDefinition) {
		super(msg);
		this.transition = transition;
		this.token = token;
		this.stateDefinition = stateDefinition;
	}

	public TansitionException(String msg, Token token, Transition transition,
			StateDefinition stateDefinition, Throwable cause) {
		super(msg, cause);
		this.transition = transition;
		this.token = token;
		this.stateDefinition = stateDefinition;
	}

	/**
	 * @return the token
	 */
	public Token getToken() {
		return token;
	}

	/**
	 * @return the transition
	 */
	public Transition getTransition() {
		return transition;
	}

	/**
	 * @return the stateDefinition
	 */
	public StateDefinition getStateDefinition() {
		return stateDefinition;
	}
}
